<template>
  <div class="bg-fa of">
    <section id="index" class="container">
    <header class="comm-title">
        <h2 class="fl tac">
         <div>
        <ul class="nav">
            <router-link to="/admin" tag="li" active-class="current">
            <a>商品管理</a>
          </router-link>
          <router-link to="/orders" tag="li" active-class="current">
            <a>我的订单</a>
          </router-link>
          <router-link to="/download" tag="li" active-class="current">
            <a>下载账单</a>
          </router-link>
        </ul>
      </div>
        </h2>
    </header>
       
      
        <el-table
    :data="tableData"
    style="width: 100%;font-size:16px;">

    <el-table-column
      label="主键ID"
      width="180">
      <template slot-scope="scope">
        <i class="el-icon-s-goods"></i>
        <span style="margin-left: 10px">{{ scope.row.id }}</span>
      </template>
    </el-table-column>
    <el-table-column
      label="创建时间"
      width="180">
      <template slot-scope="scope">
        <span style="margin-left: 5px;" >{{ scope.row.createTime }}</span>
      </template>
    </el-table-column>

    <el-table-column
      label="文章ID"
      width="180">
      <template slot-scope="scope">
        <span style="margin-left: 10px">{{ scope.row.articleId }}</span>
      </template>
    </el-table-column>
    <el-table-column
      label="用户IP"
      width="180">
      <template slot-scope="scope">
        <span style="margin-left: 10px">{{ scope.row.userIp }}</span>
      </template>
    </el-table-column>

    <el-table-column label="操作">
      <template slot-scope="scope">
        <el-button
          size="mini"
          type="primary"
          @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
      </template>
    </el-table-column>
  </el-table>
  </section>
  

  </div>
</template>
<script>

import productApi from '../api/product'
export default {

   data() {
      return {
        tableData: [],
        dialogTableVisible: false,
        dialogFormVisible: false,
        product: {
          id: null,
          title: '',
          price: '',
          stock: '',
          win: '',
        },
         formLabelWidth: '120px',
         formInputWidth: '120px'
      }
    },
  created () {
    //获取商品列表
     productApi.list().then(response => {
      this.tableData = response.data.list
    })
   
  },
  methods: {
    

  }
}   
</script>      